import os

def modifyfilename():
    #文件重命名
    bqpath=os.path.join(".","dataset","BQ")
    imglist=os.listdir(bqpath)
    for i in imglist:
        os.rename(os.path.join(bqpath,i),os.path.join(bqpath,"bq_{}".format(i)))

def parseFilename(path):
    # BQ那个文件夹里面是的，前504个是没有裂缝的，后面的505-1001是有裂缝的
    filename=os.path.basename(path)
    img_ids=int(filename.split(".")[0].split("_")[1])
    if img_ids>504:
        return 0
    else:
        return 1